function init_page(){
    {% for param in special_params %}
        container =  document.getElementById("special_fieldset");
        special_ac_cash = document.getElementById("special_ac_cash");			
        special_ac_equip = document.getElementById("special_ac_equip");
        special_ac_comm_pay = document.getElementById("special_ac_comm_pay");
        special_ac_sales_rev = document.getElementById("special_ac_sales_rev");
        special_ac_comm_exp = document.getElementById("special_ac_comm_exp");
        {% if param['param_id']=='special_ac_cash' %}
            {% for asset in assetAccounts %}
                opt = document.createElement('option');
                opt.text = "{{asset['id']}} - {{asset['name']}}";
                opt.value = "{{asset['id']}}";
                {% if special_params_details %}
                    {% for specialParams in special_params_details %}
                        {% if specialParams['code_id']==param['param_id'] and specialParams['code_value']==asset['id'] %} 
                            opt.selected = "selected";
                            span = document.createElement('span');
                            span.innerHTML = "<img width='21' height='15' src='/check_right.gif' alt='right'/>";
                            container.insertBefore(span,special_ac_cash.nextSibling);
                        {% endif %}
                    {% endfor %}
                {% endif %}
				if(navigator.userAgent.indexOf("MSIE")>=0||navigator.userAgent.indexOf("Opera")>=0){
					special_ac_cash.add(opt);		
				}else{
					special_ac_cash.appendChild(opt);
				}
            {% endfor %}
            {% if not assetAccounts %}
                em = document.createElement('em');
                em.innerHTML = 'need create an account with type ASSET';
                container.insertBefore(em,special_ac_cash.nextSibling);
            {% endif %}
        {% endif %}	
        
        {% if param['param_id']=='special_ac_equip' %}
            {% for asset in assetAccounts %}
                opt = document.createElement('option');
                opt.text = "{{asset['id']}} - {{asset['name']}}";
                opt.value = "{{asset['id']}}";
                {% if special_params_details %}
                    {% for specialParams in special_params_details %}
                        {% if specialParams['code_id']==param['param_id'] and specialParams['code_value']==asset['id'] %} 
                            opt.selected = "selected";
                            span = document.createElement('span');
                            span.innerHTML = "<img width='21' height='15' src='/check_right.gif' alt='right'/>";
                            container.insertBefore(span,special_ac_equip.nextSibling);
                        {% endif %}
                    {% endfor %}
                {% endif %}
				if(navigator.userAgent.indexOf("MSIE")>=0||navigator.userAgent.indexOf("Opera")>=0){
					special_ac_equip.add(opt);		
				}else{
					special_ac_equip.appendChild(opt);
				}
            {% endfor %}
            {% if not assetAccounts %}
                em = document.createElement('em');
                em.innerHTML = 'need create an account with type ASSET';
                container.insertBefore(em,special_ac_equip.nextSibling);
            {% endif %}
        {% endif %}
        
        {% if param['param_id']=='special_ac_comm_pay' %}
            {% for liability in liabilityAccounts %}
                opt = document.createElement('option');
                opt.text = "{{liability['id']}} - {{liability['name']}}";
                opt.value = "{{liability['id']}}";
                {% if special_params_details %}
                    {% for specialParams in special_params_details %}
                        {% if specialParams['code_id']==param['param_id'] and specialParams['code_value']==liability['id'] %} 
                            opt.selected = "selected";
                            span = document.createElement('span');
                            span.innerHTML = "<img width='21' height='15' src='/check_right.gif' alt='right'/>";
                            container.insertBefore(span,special_ac_comm_pay.nextSibling);
                        {% endif %}
                    {% endfor %}
                {% endif %}
				if(navigator.userAgent.indexOf("MSIE")>=0||navigator.userAgent.indexOf("Opera")>=0){
					special_ac_comm_pay.add(opt);		
				}else{
					special_ac_comm_pay.appendChild(opt);
				}
            {% endfor %}
            {% if not liabilityAccounts %}
                em = document.createElement('em');
                em.innerHTML = 'need create an account with type LIABILITY';
                container.insertBefore(em,special_ac_comm_pay.nextSibling);
            {% endif %}
        {% endif %}
        
        {% if param['param_id']=='special_ac_sales_rev' %}							
            {% for rev in revenueAccounts %}
                opt = document.createElement('option');
                opt.text = "{{rev['id']}} - {{rev['name']}}";
                opt.value = "{{rev['id']}}";
                {% if special_params_details %}
                    {% for specialParams in special_params_details %}
                        {% if specialParams['code_id']==param['param_id'] and specialParams['code_value']==rev['id'] %}
                            opt.selected = "selected";
                            span = document.createElement('span');
                            span.innerHTML = "<img width='21' height='15' src='/check_right.gif' alt='right'/>";
                            container.insertBefore(span,special_ac_sales_rev.nextSibling);
                        {% endif %}
                    {% endfor %}
                {% endif %}                
				if(navigator.userAgent.indexOf("MSIE")>=0||navigator.userAgent.indexOf("Opera")>=0){
					special_ac_sales_rev.add(opt);		
				}else{
					special_ac_sales_rev.appendChild(opt);
				}
            {% endfor %}
            {% if not revenueAccounts %}
                em = document.createElement('em');
                em.innerHTML = 'need create an account with type REVENUE';
                container.insertBefore(em,special_ac_sales_rev.nextSibling);
            {% endif %}
        {% endif %}
        
        {% if param['param_id']=='special_ac_comm_exp' %}							
            {% for exp in expenseAccounts %}
                opt = document.createElement('option');
                opt.text = "{{exp['id']}} - {{exp['name']}}";
                opt.value = "{{exp['id']}}";
                {% if special_params_details %}
                    {% for specialParams in special_params_details %}
                        {% if specialParams['code_id']==param['param_id'] and specialParams['code_value']==exp['id'] %}
                            opt.selected = "selected";
                            span = document.createElement('span');
                            span.innerHTML = "<img width='21' height='15' src='/check_right.gif' alt='right'/>";
                            container.insertBefore(span,special_ac_comm_exp.nextSibling);
                        {% endif %}
                    {% endfor %}
                {% endif %}
				if(navigator.userAgent.indexOf("MSIE")>=0||navigator.userAgent.indexOf("Opera")>=0){
					special_ac_comm_exp.add(opt);		
				}else{
					special_ac_comm_exp.appendChild(opt);
				}
            {% endfor %}
            {% if not expenseAccounts %}
                em = document.createElement('em');
                em.innerHTML = 'need create an account with type EXPENSE';
                container.insertBefore(em,special_ac_comm_exp.nextSibling);
            {% endif %}
        {% endif %}
    {% endfor %}
}
function user_suggestion(){
    special_ac_cash = document.getElementById("special_ac_cash");			
    special_ac_equip = document.getElementById("special_ac_equip");
    special_ac_comm_pay = document.getElementById("special_ac_comm_pay");
    special_ac_sales_rev = document.getElementById("special_ac_sales_rev");
    special_ac_comm_exp = document.getElementById("special_ac_comm_exp");
    if(special_ac_cash.value==''){
        {% for asset in assetAccounts %}
            {% if 'cash' in asset['name'].lower() %}
                special_ac_cash.value="{{asset['id']}}";
            {% endif %}
        {% endfor %}
        {% if len(assetAccounts)==1 %}
            {% for asset in assetAccounts %}
                special_ac_cash.value="{{asset['id']}}";					
            {% endfor %}
        {% endif %}
    }
    
    if(special_ac_equip.value==''){
        {% for asset in assetAccounts %}
            {% if 'equipment' in asset['name'].lower() %}
                special_ac_equip.value="{{asset['id']}}";
            {% endif %}
        {% endfor %}
        {% if len(assetAccounts)==1 %}
            {% for asset in assetAccounts %}
                special_ac_equip.value="{{asset['id']}}";					
            {% endfor %}
        {% endif %}
    }
    
    if(special_ac_comm_pay.value==''){
        {% for liability in liabilityAccounts %}
            {% if 'commission' in liability['name'].lower() %}
                special_ac_comm_pay.value="{{liability['id']}}";
            {% endif %}
        {% endfor %}
        {% if len(liabilityAccounts)==1 %}
            {% for liability in liabilityAccounts %}
                special_ac_comm_pay.value="{{liability['id']}}";					
            {% endfor %}
        {% endif %}
    }
                    
    if(special_ac_sales_rev.value==''){
        {% for rev in revenueAccounts %}
            {% if 'sales' in rev['name'].lower() %}
                special_ac_sales_rev.value="{{rev['id']}}";
            {% endif %}
        {% endfor %}
        {% if len(revenueAccounts)==1 %}
            {% for rev in revenueAccounts %}
                special_ac_sales_rev.value="{{rev['id']}}";					
            {% endfor %}
        {% endif %}
    }
    
    if(special_ac_comm_exp.value==''){
        {% for exp in expenseAccounts %}
            {% if 'commission' in exp['name'].lower() %}
                special_ac_comm_exp.value="{{exp['id']}}";
            {% endif %}
        {% endfor %}
        {% if len(expenseAccounts)==1 %}
            {% for exp in expenseAccounts %}
                special_ac_comm_exp.value="{{exp['id']}}";					
            {% endfor %}
        {% endif %}
    }
}
